fix: recover Android snapshots from system-only helper output#861
Conversation
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
Review: recover Android snapshots from degraded helper outputVerdict: not merge-ready as-is — your own PR description says as much. Two things to address before it lands. 1. The classifier doesn't cover the actual #850 repro (blocking)
The reported Fabric/newArch case is neither. Per your own live note the helper returned "status-bar nodes plus an Expo/Compose 'Tools' overlay, with
So the classifier handles "no app window" but not "app window present but content-poor", which is the bug. The new test What's missing is a content-quality signal, e.g.:
2. Heavy overlap with #862 (blocking on ordering)Both PRs rewrite the same region of Suggested order: land #862 first, rebase this on top, and let Recommend converting to draft until the classifier covers the content-poor app-window case; otherwise this merges a passing test suite that doesn't fix the linked issue. 🤖 Automated review via Claude Code |
43558e1 to
3085731
Compare
|
Addressed the review blockers:\n\n- Stacked #861 on #862 by retargeting the base to |
3085731 to
64d24e6
Compare
64d24e6 to
3105aa8
Compare
|
Latest review found a blocker: |
|
Summary
Recover Android React Native/Fabric app snapshots when helper capture is technically successful but app content would otherwise disappear from the agent-facing tree.
This handles empty/system-only/content-poor helper output by falling back to stock UIAutomator. Android hierarchy shaping now ignores transparent full-screen Expo/RN helper wrappers without letting unlabeled full-screen foreground containers with real child actions re-expose lower drawing-order background controls.
Upgraded
examples/test-appto Expo SDK 56 / React Native 0.85.3 using the official Expo upgrade flow and Expo Router SDK 56 migration guidance. Dogfood also fixed the Settings diagnostics label to reportexpo-sdk-56.Closes #850
Touched files: 12. Scope expanded from Android snapshot recovery to include the Expo test app upgrade needed for live SDK 56/RN 0.85 verification.
Coordination: PR #862 is merged, and this branch is rebased onto current
main; no remaining stacking dependency.Validation
Passed locally on head
20a51d4bf:pnpm format,pnpm check:fallow --base origin/main,pnpm exec vitest run src/platforms/android/__tests__/index.test.ts src/platforms/android/__tests__/snapshot.test.ts,pnpm check:quick, andpnpm build.Passed earlier for the upgraded test app:
pnpm --dir examples/test-app typecheckandpnpm dlx expo-doctorwith 21/21 checks.Regression coverage now includes an unlabeled full-screen covering container with a visible child button; removing the pruning fix re-exposes
Hidden drawer action. The transparent Expo tools overlay fixture still keeps underlying React Native app content visible because the full-screen wrapper only contains non-actionable helper chrome.Live Android verification on
emulator-5554: started the required Metro server withpnpm --dir examples/test-app start -- --host localhost --clear, ranadb reverse tcp:8081 tcp:8081, openedAgent Device Testerthrough Expo Go, and captured interactive snapshots plus overlay screenshots. Current blocker evidence artifacts are under/private/tmp/agent-device-861-blocker/{snapshots,screenshots}.Updated live evidence covered Home, a foreground native confirmation alert, Catalog, Form, and Settings. The alert snapshot returned only
Confirm catalog refresh,KEEP BROWSING, andCONFIRM REFRESHwhile the screenshot showed dimmed background controls, proving the foreground surface did not re-expose hidden background controls. Catalog/Form/Settings snapshots continued to return compact app content, and Settings capturedBuild: expo-sdk-56 / lab-fixture-1.Before the parser fix, the shipped path returned only 8 nodes from
android-helper(ComposeViewplus ExpoTools) while raw UIAutomator saw the app. After the fix, the shipped snapshot path returnedsuccess=true,androidSnapshot.backend=android-helper,captureMode=interactive-windows,windowCount=2, helpernodeCount=272, and shaped nodes includingCatalog,Search,Citrus Starter Kit,Form, andSettings.Known residual risk: this was verified with the repo Expo Go SDK 56/RN 0.85.3 app rather than the original reporter app, but it exercises the live Fabric/Expo overlay failure mode that previously reproduced system/status/Tools-only output and the foreground-alert/background-control pruning risk raised in review.
Current PR state: ready for review on head
20a51d4bf; CI is green.